﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Windows8Accelerator.Core.Xaml.Helpers
{
    public abstract class HtmlHelperBase 
    {
        private static HtmlHelperBase _Instance;
        public static HtmlHelperBase Instance
        {
            get
            {
                if (_Instance == null)
                    _Instance = AssemblyHelper.CreateInstanceOfAccelerator<HtmlHelperBase>();
                return _Instance;
            }
        }

        public static string AdjustUrl(string url, Uri baseUri)
        {
            if (Uri.IsWellFormedUriString(url, UriKind.Absolute))
                return url;
            return (new Uri(baseUri, url)).OriginalString;
        }

        public abstract string ConvertToText(string html);
        public abstract Task PreLoadHtmlImagesAsync(string html);
    }
}
